#include "sleeexcelsheet.h"

SleeExcelSheet::SleeExcelSheet(const SleeQAxPtr &exsheet, quint32 id):
    m_sheet(exsheet),
    m_id(id)
{
}


QVariant SleeExcelSheet::get(int row, int column)
{
    QAxObject *p_cell = m_sheet.mp->querySubObject("Cells(QVariant, QVariant)", QVariant(row), QVariant(column));
    QVariant qv_ret = p_cell->property("Value");
    delete p_cell;
    return qv_ret;
}

void SleeExcelSheet::put(int row, int column, QVariant &qv_data)
{
    QAxObject *p_cell = m_sheet.mp->querySubObject("Cells(QVariant, QVariant)", QVariant(row), QVariant(column));
    p_cell->setProperty("Value", qv_data);
    delete p_cell;
}

void SleeExcelSheet::print_out()
{
    m_sheet.mp->dynamicCall("PrintOut");
}
